
import request from '@/utils/request'
import { getToken } from '@/utils/token'
// 获取默认频道列表
export const getChannelListAPI = () => request({
  url: '/v1_0/channels'
})

// 登录
export const loginAPI = ({ mobile, code }) => {
  return request({
    url: '/v1_0/authorizations',
    method: 'POST',
    data: {
      mobile,
      code
    }

  })
}

export const UserChannelListAPI = () => {
  return request({
    url: '/v1_0/user/channels',
    headers: {
      Authorizatoan: `Bearer ${getToken()}`
    }
  })
}

// 获取文章详情
export const articleDetailAPI = (channelId) => request({
  url: '/v1_0/articles',
  headers: {
    Authorizatoan: `Bearer ${getToken()}`
  },
  params: {
    channel_id: channelId,
    timestamp: new Date()
  }
})
